﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Newtonsoft.Json;

namespace ShopeeSdk
{
    public abstract class ShopeeRequest<T> where T : ShopeeResponse
    {
        /// <summary>
        /// 调用地址结尾路径：例如https://partner.shopeemobile.com/api/v1/image/upload中的 image/upload
        /// </summary>
        [JsonIgnore]
        public abstract string RequestUrlEndPath { get; }

        /// <summary>
        /// 使用DefaultShopeeClient时会自动赋值
        /// </summary>
        [JsonProperty("partner_id")]
        public int PartnerId { get; set; }

        /// <summary>
        /// 使用DefaultShopeeClient会自动赋值
        /// </summary>
        [JsonProperty("shopid")]
        public int ShopId { get; set; }

        [JsonProperty("timestamp")]
        public int Timestamp => (Int32)(DateTime.UtcNow.Subtract(new DateTime(1970, 1, 1))).TotalSeconds;
    }
}
